/**
 ============================================================================
 Author     : Jonathan MERCIER
 Version    : 0.1
 License    : GPL v3+
 Copyright  : (c)Jonathan MERCIER (read doc for more information)

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 Description :
 ============================================================================
 */

import tango.io.device.File         : File;
import Parser;
import metatool                     : printDebug;
import Integer = tango.text.convert.Integer;

class Controller {
private:
    File inputFile;
    File outputFile;
public:
    /**
     * Constructor
     * Params:
     *  inputFile   
     *  outputFile
     */
    this(File inputFile, File outputFile){
        printDebug("controller object is created");
        this.inputFile  = inputFile;
        printDebug("input file: "~inputFile.toString);
        this.outputFile = outputFile;
        printDebug("output file: "~outputFile.toString);
        
    }
    /**
     * Constructor
     * Params:
     *  inputPath   
     *  outputPath
     */
    this(char[] inputPath, char[] outputPath){
        printDebug("controller object is created");
        inputFile   = new File(inputPath);
        printDebug("input file: "~inputPath);
        outputFile  = new File(outputPath);
        printDebug("output file: "~outputPath);
    }
    /**
     * Destructor
     */
    ~this(){
        
    }
    /**
     * start controller method
     */
    void start(){
        printDebug("controller start ...");
        auto parser = new Parser(inputFile);
        parser.run;
        auto enzrev = parser.getEnzrev;
        printDebug("Enzrev length: "~Integer.toString(enzrev.length));
        auto enzirrev = parser.getEnzirrev;
        printDebug("Enzirrev length: "~Integer.toString(enzirrev.length));
        auto metext = parser.getMetext;
        printDebug("Metext length: "~Integer.toString(metext.length));
        auto metint = parser.getMetint;
        printDebug("Metint length: "~Integer.toString(metint.length));
        auto cat = parser.getCat;
        printDebug("Cat length: "~Integer.toString(cat.length));
    }
}
